package com.enjoy.spring.cloudalibabachapter03.selector;

import com.enjoy.spring.cloudalibabachapter03.pojo.FirstClass;
import com.enjoy.spring.cloudalibabachapter03.pojo.SecondClass;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * 演示springboot自动装配
 */
public class MyImportSelector implements ImportSelector {
    /**
     * 通过selectImports可以返回一个全类名数组，将多个POJO放入IOC容器中，
     *
     * @param annotationMetadata
     * @return
     */
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
        return new String[]{FirstClass.class.getName(),SecondClass.class.getName()};
    }
}
